<template>
  <div class="moneyDetail">
    <el-form :model="formInline" :rules="rules" ref="ruleForm" label-width="180px" class="demo-ruleForm">
      <el-form-item label="营业执照：" prop="businessLicenseImg">
        <div class="imgList">
          <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
              (response, file, fileList) =>
                handleAvatarSuccess(2, response, file, fileList)
            " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
            <img v-if="formInline.businessLicenseImg" :src="httpImg + formInline.businessLicenseImg" class="img" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>

          </el-upload>
          <div class="lable">
            <p class="watch_img" @click="handleFang(httpImg + formInline.businessLicenseImg)">查看图片</p>
          </div>
        </div>
      </el-form-item>
      <el-form-item label="统一信用社代码：" prop="businessLicenseNumber">
        <el-input v-model="formInline.businessLicenseNumber" placeholder="统一信用社代码"></el-input>
      </el-form-item>
      <el-form-item label="企业名称：" prop="merchantName">
        <el-input v-model="formInline.merchantName" placeholder="请输入企业名称"></el-input>
      </el-form-item>
      <el-form-item label="法人姓名：" prop="name">
        <el-input v-model="formInline.name" placeholder="请输入法人姓名"></el-input>
      </el-form-item>
      <el-form-item label="法人联系电话：" prop="legalPersonPhone">
        <el-input v-model="formInline.legalPersonPhone" placeholder="请输入法人联系电话"></el-input>
      </el-form-item>
      <el-form-item label="注册地址：" prop="address">
        <el-input v-model="formInline.address" placeholder="请输入注册地址"></el-input>
      </el-form-item>
      <el-form-item label="企业类别：" prop="merchantType">
        <el-select v-model="formInline.merchantType" placeholder="请选择">
          <el-option v-for="item in enterpriseList" :key="item.id" :label="item.value" :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="注册资金：" prop="registeredFund" v-if="formInline.merchantType == 1">
        <el-input v-model="formInline.registeredFund" placeholder="请输入注册资金"></el-input>
      </el-form-item>
      <el-form-item label="成立日期：" prop="businessLicenseStartDate">
        <el-date-picker v-model="formInline.businessLicenseStartDate" type="date" placeholder="选择日期" format="yyyy.MM.dd"
          value-format="yyyy.MM.dd" :clearable="false">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="经营期限：" :prop="radio == 1 ? 'businessLicenseEndDate' : ''">
        <el-radio-group v-model="radio" @change="changeRadio">
          <el-radio :label="1">
            <el-date-picker v-model="formInline.businessLicenseEndDate" type="date" placeholder="选择日期"
              format="yyyy.MM.dd" value-format="yyyy.MM.dd" :clearable="false" :disabled="pickDisabled" style="width: 240px !important">
            </el-date-picker>
          </el-radio>
          <el-radio :label="2" style="margin-top: 10px">长期</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="店铺名称：" prop="shopName">
        <el-input v-model="formInline.shopName" placeholder="请输入店铺名称"></el-input>
      </el-form-item>
      <el-form-item label="店铺类型：" prop="shopType">
        <el-cascader v-model="formInline.shopType" :options="typeLs" :show-all-levels="false" @change="handleChange">
        </el-cascader>
      </el-form-item>
      <el-form-item label="门头照：" prop="shopTopImg">
        <div class="imgList">
          <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
              (response, file, fileList) =>
                handleAvatarSuccess(3, response, file, fileList)
            " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
            <img v-if="formInline.shopTopImg" :src="httpImg + formInline.shopTopImg" class="img" />
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>

          </el-upload>
          <div class="lable">
            <p class="watch_img" @click="handleFang(httpImg + formInline.shopTopImg)">查看图片</p>
          </div>
        </div>
      </el-form-item>
      <el-form-item label="店铺介绍：" prop="introduce">
        <el-input type="textarea" :autosize="{ minRows: 5}" placeholder="请输入店铺介绍" v-model="formInline.introduce">
        </el-input>
      </el-form-item>
      <el-form-item label="结算类型：" prop="settleBankType">
        <el-select v-model="formInline.settleBankType" placeholder="请选择" @change="changeBankType">
          <el-option v-for="item in settleBankTypeList" :key="item.id" :label="item.value" :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <!-- 对公结算 -->
      <template v-if="formInline.settleBankType == 1">
        <div class="listImg">
          <el-form-item label="法人身份证正面:" prop="frontOfIdCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(4, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.frontOfIdCard" :src="httpImg + formInline.frontOfIdCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.frontOfIdCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
          <el-form-item label="法人身份证反面:" prop="backOfIdCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(5, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.backOfIdCard" :src="httpImg + formInline.backOfIdCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.backOfIdCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
        </div>
        <el-form-item label="法人姓名：" prop="legalPerson">
          <el-input v-model="formInline.legalPerson" placeholder="请输入法人姓名"></el-input>
        </el-form-item>
        <el-form-item label="法人身份证号：" prop="legalPersonId">
          <el-input v-model="formInline.legalPersonId" placeholder="请输入法人身份证号"></el-input>
        </el-form-item>
        <el-form-item label="法人身份证有效期：" prop="legalPersonIdCardValidDate">
          <el-input v-model="formInline.legalPersonIdCardValidDate" placeholder="请输入法人身份证有效期"></el-input>
        </el-form-item>
        <el-form-item label="开户许可证:" prop="permitForBankAccount">
          <div class="imgList">
            <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                (response, file, fileList) =>
                  handleAvatarSuccess(6, response, file, fileList)
              " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
              <img v-if="formInline.permitForBankAccount" :src="httpImg + formInline.permitForBankAccount"
                class="img" />
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>

            </el-upload>
            <div class="lable">
              <p class="watch_img" @click="handleFang(httpImg + formInline.permitForBankAccount)">查看图片</p>
            </div>
          </div>
        </el-form-item>
        <el-form-item label="银行名称：" prop="accountName">
          <el-input v-model="formInline.accountName" placeholder="请输入银行名称"
            :disabled="formInline.cities.length==0?false:true"></el-input>
          <el-tooltip class="item" effect="dark" content="如需更改开户行，请先删除银行地区" placement="top-start"
            v-if="formInline.cities.length!=0">
            <div class="el-icon-question" style="color: red;margin-left: 10px;cursor: pointer"></div>
          </el-tooltip>
        </el-form-item>
        <el-form-item label="开户行卡号：" prop="accountNo">
          <el-input v-model="formInline.accountNo" placeholder="请输入开户行卡号"></el-input>
        </el-form-item>
        <el-form-item label="支行所属城市：" prop="cities">
          <el-cascader v-model="formInline.cities" :options="cityList" :props="CityProp" :show-all-levels="false"
            clearable @change="handleCity" style="width: 350px"></el-cascader>
        </el-form-item>
        <el-form-item label="所属开户行支行：" prop="bankName">
          <el-select v-model="formInline.bankName" placeholder="请选择" :disabled="isBankName" @change="changesBranch">
            <el-option v-for="item in bankNameList" :key="item.bankCode" :label="item.bankName" :value="item.bankCode">
            </el-option>
          </el-select>
        </el-form-item>
      </template>

      <!-- 对法人私卡结算 -->
      <template v-if="formInline.settleBankType == 2 || formInline.settleBankType == 4">
        <div class="listImg">
          <el-form-item label="法人身份证正面:" prop="frontOfIdCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(4, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.frontOfIdCard" :src="httpImg + formInline.frontOfIdCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.frontOfIdCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
          <el-form-item label="法人身份证反面:" prop="backOfIdCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(5, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.backOfIdCard" :src="httpImg + formInline.backOfIdCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.backOfIdCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
        </div>
        <el-form-item label="法人姓名：" prop="legalPerson">
          <el-input v-model="formInline.legalPerson" placeholder="请输入法人姓名"></el-input>
        </el-form-item>
        <el-form-item label="法人身份证号：" prop="legalPersonId">
          <el-input v-model="formInline.legalPersonId" placeholder="请输入法人身份证号"></el-input>
        </el-form-item>
        <el-form-item label="法人身份证有效期：" prop="legalPersonIdCardValidDate">
          <el-input v-model="formInline.legalPersonIdCardValidDate" placeholder="请输入法人身份证有效期"></el-input>
        </el-form-item>
        <div class="listImg">
          <el-form-item label="法人银行卡正面:" prop="bankCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(7, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.bankCard" :src="httpImg + formInline.bankCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.bankCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
          <el-form-item label="法人银行卡反面:" prop="bankCardBack">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(8, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.bankCardBack" :src="httpImg + formInline.bankCardBack" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.bankCardBack)">查看图片</p>
              </div>
            </div>
          </el-form-item>
        </div>
        <el-form-item label="开户名称：" prop="settleName">
          <el-input v-model="formInline.settleName" placeholder="请输入开户名称"></el-input>
        </el-form-item>
        <el-form-item label="银行名称：" prop="accountName">
          <el-input v-model="formInline.accountName" placeholder="请输入银行名称"
            :disabled="formInline.cities.length==0?false:true"></el-input>
          <el-tooltip class="item" effect="dark" content="如需更改开户行，请先删除银行地区" placement="top-start"
            v-if="formInline.cities.length!=0">
            <div class="el-icon-question" style="color: red;margin-left: 10px;cursor: pointer"></div>
          </el-tooltip>
        </el-form-item>
        <el-form-item label="开户行卡号：" prop="accountNo">
          <el-input v-model="formInline.accountNo" placeholder="请输入开户行卡号"></el-input>
        </el-form-item>
        <el-form-item label="支行所属城市：" prop="cities">
          <el-cascader v-model="formInline.cities" :options="cityList" :props="CityProp" :show-all-levels="false"
            clearable @change="handleCity" style="width: 350px"></el-cascader>
        </el-form-item>
        <el-form-item label="所属开户行支行：" prop="bankName">
          <el-select v-model="formInline.bankName" placeholder="请选择" :disabled="isBankName" @change="changesBranch">
            <el-option v-for="item in bankNameList" :key="item.bankCode" :label="item.bankName" :value="item.bankCode">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="银行预留手机号：" prop="bankMobile">
          <el-input v-model="formInline.bankMobile" placeholder="请输入银行预留手机号"></el-input>
        </el-form-item>
      </template>

      <!-- 对非法人私卡结算 -->
      <template v-if="formInline.settleBankType == 3">
        <div class="listImg">
          <el-form-item label="法人身份证正面:" prop="fundFrontOfIdCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(9, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.fundFrontOfIdCard" :src="httpImg + formInline.fundFrontOfIdCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.fundFrontOfIdCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
          <el-form-item label="法人身份证反面:" prop="fundBackOfIdCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(10, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.fundBackOfIdCard" :src="httpImg + formInline.fundBackOfIdCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.fundBackOfIdCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
        </div>
        <el-form-item label="法人姓名：" prop="fundLegalPerson">
          <el-input v-model="formInline.fundLegalPerson" placeholder="请输入法人姓名"></el-input>
        </el-form-item>
        <el-form-item label="法人身份证号：" prop="fundLegalPersonId">
          <el-input v-model="formInline.fundLegalPersonId" placeholder="请输入法人身份证号"></el-input>
        </el-form-item>

        <el-form-item label="法人身份证有效期：" prop="fundLPersonIdCardValidDate">
          <el-input v-model="formInline.fundLPersonIdCardValidDate" placeholder="请输入法人身份证有效期"></el-input>
        </el-form-item>
        <div class="listImg">
          <el-form-item label="法人银行卡正面:" prop="bankCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(7, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.bankCard" :src="httpImg + formInline.bankCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.bankCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
          <el-form-item label="法人银行卡反面:" prop="bankCardBack">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(8, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.bankCardBack" :src="httpImg + formInline.bankCardBack" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.bankCardBack)">查看图片</p>
              </div>
            </div>
          </el-form-item>
        </div>
        <el-form-item label="开户名称：" prop="settleName">
          <el-input v-model="formInline.settleName" placeholder="请输入银行名称"></el-input>
        </el-form-item>
        <el-form-item label="银行名称：" prop="accountName">
          <el-input v-model="formInline.accountName" placeholder="请输入银行名称"
            :disabled="formInline.cities.length==0?false:true"></el-input>
          <el-tooltip class="item" effect="dark" content="如需更改开户行，请先删除银行地区" placement="top-start"
            v-if="formInline.cities.length!=0">
            <div class="el-icon-question" style="color: red;margin-left: 10px;cursor: pointer"></div>
          </el-tooltip>
        </el-form-item>
        <el-form-item label="开户行卡号：" prop="accountNo">
          <el-input v-model="formInline.accountNo" placeholder="请输入开户行卡号"></el-input>
        </el-form-item>
        <el-form-item label="支行所属城市：" prop="cities">
          <el-cascader v-model="formInline.cities" :options="cityList" :props="CityProp" :show-all-levels="false"
            clearable @change="handleCity" style="width: 350px"></el-cascader>
        </el-form-item>
        <el-form-item label="所属开户行支行：" prop="bankName">
          <el-select v-model="formInline.bankName" placeholder="请选择" :disabled="isBankName" @change="changesBranch">
            <el-option v-for="item in bankNameList" :key="item.bankCode" :label="item.bankName" :value="item.bankCode">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="银行预留手机号：" prop="bankMobile">
          <el-input v-model="formInline.bankMobile" placeholder="请输入银行预留手机号"></el-input>
        </el-form-item>
        <div class="listImg">
          <el-form-item label="收款人身份证正面:" prop="frontOfIdCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(4, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.frontOfIdCard" :src="httpImg + formInline.frontOfIdCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.frontOfIdCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
          <el-form-item label="收款人身份证反面:" prop="backOfIdCard">
            <div class="imgList">
              <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                  (response, file, fileList) =>
                    handleAvatarSuccess(5, response, file, fileList)
                " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
                <img v-if="formInline.backOfIdCard" :src="httpImg + formInline.backOfIdCard" class="img" />
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>

              </el-upload>
              <div class="lable">
                <p class="watch_img" @click="handleFang(httpImg + formInline.backOfIdCard)">查看图片</p>
              </div>
            </div>
          </el-form-item>
        </div>
        <el-form-item label="收款人姓名：" prop="legalPerson">
          <el-input v-model="formInline.legalPerson" placeholder="请输入法人姓名"></el-input>
        </el-form-item>
        <el-form-item label="收款人身份证号：" prop="legalPersonId">
          <el-input v-model="formInline.legalPersonId" placeholder="请输入法人身份证号"></el-input>
        </el-form-item>
        <el-form-item label="收款人身份证有效期：" prop="legalPersonIdCardValidDate">
          <el-input v-model="formInline.legalPersonIdCardValidDate" placeholder="请输入法人身份证有效期"></el-input>
        </el-form-item>
        <el-form-item label="法人持授权函正面照:" prop="authorization">
          <div class="imgList">
            <el-upload class="avatar-uploader" :action="action" :show-file-list="false" :on-success="
                (response, file, fileList) =>
                  handleAvatarSuccess(11, response, file, fileList)
              " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
              <img v-if="formInline.authorization" :src="httpImg + formInline.authorization" class="img" />
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>

            </el-upload>
            <div class="lable">
              <p class="watch_img" @click="handleFang(httpImg + formInline.authorization)">查看图片</p>
            </div>
          </div>
        </el-form-item>
      </template>
      <!-- 备用结算信息（企业商户对法人私卡结算时，需要填写备用结算信息） -->
      <template v-if="formInline.merchantType == '1' && formInline.settleBankType == '2'">
        <p class="standby_txt">备用结算信息：（请填写对公账户信息）</p>
        <el-form-item label="结算账号：" prop="standStlAccNo" key="23">
            <el-input v-model="formInline.standStlAccNo" placeholder="请输入" :style="{ width: inputWidth }"></el-input>
            <el-button style="margin-left: 30px" type="primary" size="small" @click="openingBankStand(formInline.standStlAccNo)" :loading="mateLoading">查询匹配开户行</el-button>
        </el-form-item>
          <el-form-item label="开户行名称：" prop="localStandBankName" key="24">
            <el-input v-model="formInline.localStandBankName" placeholder="请输入" :disabled="formInline.standBankRegionAvalue.length==0?false:true" :style="{ width: inputWidth }"></el-input>
              <el-tooltip class="item" effect="dark" content="如需更改开户行，请先删除银行地区" placement="top-start" v-if="formInline.standBankRegionAvalue.length!=0">
                <div class="el-icon-question" style="color: red;margin-left: 10px;cursor: pointer"></div>
              </el-tooltip>
            </el-form-item>
            <el-form-item label="银行地区：" prop="standBankRegionAvalue" ref="standBankRegionAvalueRef" key="25">
              <el-cascader :options="cityList" :props="{ value: 'id',label: 'label',children: 'children'}"
                  filterable @change="standBankRegionChange" v-model="formInline.standBankRegionAvalue" clearable :style="{ width: inputWidth }">
              </el-cascader>
            </el-form-item>
            <el-form-item label="所属支行名称：" prop="standBankSubCode" key="26">
              <el-select v-model="formInline.standBankSubCode" placeholder="请选择" filterable @change="changesTwoStand" v-loading="viewLoading" element-loading-text="支行加载中" :style="{ width: inputWidth }">
                  <el-option v-for="item in bankOptiontwoStand" :key="item.bankCode" :label="item.bankName" :value="item.bankCode"></el-option>
              </el-select>
            </el-form-item>
      </template>
      <el-form-item>
        <el-button style="margin-right: 30px;margin-top: 40px" @click="handleClose">取消</el-button>
        <el-button type="primary" v-if="typePath=='add'" :loading="buttonLoading" @click="submitForm('ruleForm')">确认
        </el-button>
        <el-button type="primary" v-if="typePath=='edit'" :loading="buttonLoading" @click="updateMerchant('ruleForm')">
          更新</el-button>
      </el-form-item>
    </el-form>
    <img-detail-dialog v-if="ImgDetailDialog" :id="id" :imgUrl="urlData" :visible.sync="ImgDetailDialog" />
  </div>
</template>
<script>
  // components
  import Loading from "@/components/Loading/index";
  import imgDetailDialog from "../components/imgDetailDialog";

  //api
  import {
    adminDict,
    getBank,
    addMerchant,
    getmerchantDetail,
    updateMerchant,
    saveMerchantShop,
    watermarkUploadFile,
    bankCity,
    bankBranch,
    licenseInfo,
    idCardInfo,
    bankInfo,
    addChainstore,
    editChainstore,
    chainDetail,
    entryV1FuncYSBankBin
  } from "@/api/chainManagement";
  import {
    shopTypeTree,
    getBankCity,
    getBankBranch
  } from "@/api/merchants";
  // import {
  //   List
  // } from "echarts/lib/export";

  export default {
    components: {
      Loading,
      imgDetailDialog,
    },
    props: {
      visible: Boolean,
      id: String,
    },
    data() {
      return {
        inputWidth: '350px',
        action: process.env.VUE_APP_BASE_API + "/common/v1/uploadFile",
        ImgDetailDialog: false,
        httpImg: '',
        loading: false,
        allLoading: false,
        buttonLoading: false,
        enterpriseList: [{
            id: "1",
            value: '企业法人'
          },
          {
            id: "2",
            value: '个体商户'
          }
        ],
        options: [],
        radio: 2, //经营期限选择
        pickDisabled: true, //是否禁用经营期限时间选择
        qxDate: '',
        typeLs: [],
        avalue: [],
        settleBankTypeList: [],
        bankOptiontwo: [],

        cityList: [],
        isBankName: true, //是否可以选择银行
        bankNameList: [], //银行列表
        chainId: '',
        merchantId: '',
        typePath: '',
        formInline: {
          businessLicenseImg: '', //营业执照图片
          businessLicenseNumber: '', //营业执照号	
          merchantName: '', //企业名称	
          name: '', //法人名称	
          legalPersonPhone: '', //法人联系电话
          address: '', //	联系地址
          merchantType: '', //商家类型	
          registeredFund: '', //注册资金
          businessLicenseStartDate: '', //成立日期
          businessLicenseEndDate: '', //	营业执照经营期限
          shopName: '', //店铺名称	
          shopTypeParent: '', //	店铺类型父类型
          shopType: '', //店铺类型子类型	
          shopTypeName: '', //店铺类型子类型名称	
          shopTopImg: '', //店铺门头照	
          introduce: '', //店铺介绍	
          settleBankType: '', //结算卡类型  1 对公 2 对法人私卡 3 对非法人私卡 4 临时账号	
          frontOfIdCard: '', //法人身份证正面（非法人结算时，这个是结算人身份证正面）	
          backOfIdCard: '', //法人身份证反面（非法人结算时，这个是结算人身份证翻面）	
          legalPerson: '', //法人名称	
          legalPersonId: '', //法人身份证号	
          legalPersonIdCardValidDate: '', //法人身份证有效期	
          permitForBankAccount: '', //	开户许可证
          accountName: '', //开户银行名称	
          accountNo: '', //开户账号
          bankName: '', //开户银行支行
          bankCode: '',
          cities: [], //省市路径
          province: '',
          city: '',
          bankCard: '', //法人银行卡照片	
          bankCardBack: '', //法人银行卡照片背面
          bankMobile: '', //银行预留手机号
          settleName: '', //结算人名称	
          fundFrontOfIdCard: '', //资金帐号法人身份证正面（用于对非法人私卡结算类型）	
          fundBackOfIdCard: '', //资金帐号法人身份证反面（用于对非法人私卡结算类型）	
          fundLegalPerson: '', //资金帐号法人名字（用于对非法人私卡结算类型）	
          fundLegalPersonId: '', //资金帐号法人身份证号（用于对非法人私卡结算类型）	
          fundLPersonIdCardValidDate: '', //	资金帐号法人身份证有效期（用于对非法人私卡结算类型）
          authorization: '', //法人授权函	
          watermarkBusinessLicenseImg: '', //营业执照图片(水印营业执照)	
          isSkip: 2, //是否跳过收款帐号信息录入  1 跳过  2 不跳过	
          legalPersonSex: '', //法人性别	
          localStandBankName:'',//备用结算银行名称
          localStandBankSubName:'',//备用结算银行支行名称
          standBankCity:'',//备用结算账户银行开户行市代码
          standBankProvince:'',//备用结算账户银行开户行省代码
          standBankSubCode:'',//备用结算账户开户行支行编号
          standStlAccNo:'',//备用结算账号
          standBankRegionAvalue:[],//银行城市回显
        },
        rules: {
          businessLicenseImg: [{
            required: true,
            message: '请上传营业执照',
            trigger: ['blur', 'change']
          }, ],
          businessLicenseNumber: [{
            required: true,
            message: '请输入统一信用社代码',
            trigger: ['blur', 'change']
          }, ],
          merchantName: [{
            required: true,
            message: '请输入企业名称',
            trigger: ['blur', 'change']
          }, ],
          name: [{
            required: true,
            message: '请输入法人姓名',
            trigger: ['blur', 'change']
          }, ],
          legalPersonPhone: [{
            required: true,
            message: '请输入法人联系电话',
            trigger: ['blur', 'change']
          }, ],
          address: [{
            required: true,
            message: '请输入注册地址',
            trigger: ['blur', 'change']
          }, ],
          merchantType: [{
            required: true,
            message: '请选择',
            trigger: ['blur', 'change']
          }],
          registeredFund: [{
            required: true,
            message: '请输入注册资金',
            trigger: ['blur', 'change']
          }, ],
          businessLicenseStartDate: [{
            required: true,
            message: '请选择',
            trigger: ['blur', 'change']
          }],
          businessLicenseEndDate: [{
            required: true,
            message: '请选择',
            trigger: ['blur', 'change']
          }],
          shopName: [{
            required: true,
            message: '请输入店铺名称',
            trigger: ['blur', 'change']
          }, ],
          shopType: [{
            required: true,
            message: '请选择',
            trigger: ['blur', 'change']
          }],
          shopTopImg: [{
            required: true,
            message: '请上传门头照',
            trigger: ['blur', 'change']
          }, ],
          introduce: [{
            required: true,
            message: '请输入店铺介绍',
            trigger: ['blur', 'change']
          }, ],
          settleBankType: [{
            required: true,
            message: '请选择',
            trigger: ['blur', 'change']
          }],
          frontOfIdCard: [{
            required: true,
            message: '请上传身份证正面',
            trigger: ['blur', 'change']
          }, ],
          backOfIdCard: [{
            required: true,
            message: '请上传身份证反面',
            trigger: ['blur', 'change']
          }, ],
          legalPerson: [{
            required: true,
            message: '请输入法人姓名',
            trigger: ['blur', 'change']
          }, ],
          legalPersonId: [{
            required: true,
            message: '请输入法人身份证号',
            trigger: ['blur', 'change']
          }, ],
          legalPersonIdCardValidDate: [{
            required: true,
            message: '请输入法人身份证有效期',
            trigger: ['blur', 'change']
          }, ],
          permitForBankAccount: [{
            required: true,
            message: '请上传开户许可证',
            trigger: ['blur', 'change']
          }, ],
          accountName: [{
            required: true,
            message: '请输入银行名称',
            trigger: ['blur', 'change']
          }, ],
          cities: [{
            required: true,
            message: '请选择',
            trigger: ['blur', 'change']
          }],
          bankName: [{
            required: true,
            message: '请选择',
            trigger: ['blur', 'change']
          }],
          accountNo: [{
            required: true,
            message: '请输入开户行卡号',
            trigger: ['blur', 'change']
          }, ],
          bankCard: [{
            required: true,
            message: '请上传法人银行卡正面',
            trigger: ['blur', 'change']
          }, ],
          bankCardBack: [{
            required: true,
            message: '请上传法人银行卡反面',
            trigger: ['blur', 'change']
          }, ],
          bankMobile: [{
            required: true,
            message: '请输入银行预留手机号',
            trigger: ['blur', 'change']
          }, ],
          settleName: [{
            required: true,
            message: '请输入开户名称',
            trigger: ['blur', 'change']
          }, ],
          fundFrontOfIdCard: [{
            required: true,
            message: '请上传身份证正面',
            trigger: ['blur', 'change']
          }, ],
          fundBackOfIdCard: [{
            required: true,
            message: '请上传身份证反面',
            trigger: ['blur', 'change']
          }, ],
          fundLegalPerson: [{
            required: true,
            message: '请输入法人姓名',
            trigger: ['blur', 'change']
          }, ],
          fundLegalPersonId: [{
            required: true,
            message: '请输入法人身份证号',
            trigger: ['blur', 'change']
          }, ],
          fundLPersonIdCardValidDate: [{
            required: true,
            message: '请输入法人身份证有效期',
            trigger: ['blur', 'change']
          }, ],
          authorization: [{
            required: true,
            message: '请上传法人持授权函正面照',
            trigger: ['blur', 'change']
          }, ],
          standStlAccNo: [{
              required: true,
              message: '请输入结算账号',
              trigger: ['blur', 'change']
          }],
          localStandBankName: [{
              required: true,
              message: '请输入开户行名称',
              trigger: ['blur', 'change']
          }],
          standBankRegionAvalue: [{
            required: true,
            message: '选择银行地区',
            trigger: ['change']
          }],
          standBankSubCode: [{
            required: true,
            message: '请选择所属支行名称',
            trigger: ['blur', 'change']
          }],
        },
        CityProp: {
          value: 'id',
          lable: 'lable',
          //获取结算方式字典
        },
        viewLoading: false,
        standBankRegionAvalue:[],//银行城市回显
        bankOptiontwoStand:[],//备用支行
        mateLoading: false,//查询匹配loading
      };
    },
    computed: {},
    created() {
      this.chainId = this.$route.query.chainId;
      this.merchantId = this.$route.query.merchantId
      this.typePath = this.$route.query.type
      this.getTypels();
      this.getbankType();
      // this.bankCity()
      this.getBankCitys();
      if (this.typePath == 'edit') {
        this.getDetail()
      } else if (this.typePath == 'look') {
        this.getDetail()
      }

    },
    methods: {
      getlinkagelist() {
        //获取商户类型字典
        const params = {
          dictType: "merchant_type",
        };
        adminDict(params).then((res) => {
          this.options = res.result[0].dictList;
        });
      },
      getclearingType() {
        //获取结算类型字典
        const params = {
          dictType: "merchant_clearing_type",
        };
        adminDict(params).then((res) => {
          this.options3 = res.result[0].dictList;
        });
      },
      // 获取店铺类型
      getTypels() {
        //shopTypeTree
        this.loading = true;
        shopTypeTree()
          .then((res) => {
            let ls = [];
            console.log("res.result+++", res.result);
            ls = this.getTreeData(res.result);
            // console.log(this.typeLs)
            let ls1 = ls.map((item) => {
              item.value = item.id;
              item.children.map((items) => {
                items.value = items.id;
              });
              return item;
            });
            console.log("ls1+++", ls1);
            this.typeLs = ls1;
          })
          .finally(() => {
            this.loading = false;
          });
      },
      getTreeData(data) {
        // 循环遍历json数据
        for (var i = 0; i < data.length; i++) {
          if (data[i].children.length < 1) {
            // children若为空数组，则将children设为undefined
            // data[i].children=undefined;
            delete data[i].children;
          } else {
            // children若不为空数组，则继续 递归调用 本方法
            this.getTreeData(data[i].children);
          }
        }
        return data;
      },
      //查询银行城市
      bankCity() {
        bankCity()
          .then((res) => {
            this.cityList = this.getTreeData(res.result)
          })
          .finally(() => {
            this.loading = false;
          });
      },
      //查询银行支行
      getbankBranchList() {
        var params = {
          provinceId: this.formInline.province,
          cityId: this.formInline.city,
          bankName: this.formInline.accountName
        }
        console.log('params', params)
        bankBranch(params)
          .then((res) => {
            this.bankNameList = res.result
          })
      },
      // handleCity(e) {
      //   this.formInline.province = e[0]
      //   this.formInline.city = e[1]
      //   this.isBankName = false
      //   this.getbankBranchList()
      // },


      getBankCitys() { //中台查询银行银盛城市
        let params = {}
        getBankCity(params).then((res) => {
          this.cityList = res.result;
          this.cityList.forEach((item) => {
            item.children.forEach((items) => {
              if (items.children.length == 0) {
                items.children = null
              }
            })
          })
        });
      },
      //银行区域选择
      handleCity(value) {
        if (value.length == 0) {
          this.formInline.cities = []
          this.formInline.bankName = '';
          this.formInline.bankCode = '';
          this.bankNameList = []
          return
        }
        this.formInline.province = value[0];
        this.formInline.city = value[1];
        if (this.formInline.accountName == '') {
          this.$message.error('请输入银行名称');
          this.formInline.cities = []
          this.formInline.bankName = '';
          this.formInline.bankCode = '';
          this.bankNameList = []
          return
        } else {
          this.getBankBranchs()
        }
        this.formInline.bankName = '';
        this.formInline.bankCode = '';
      },
      getBankBranchs() { //获取支行信息
        const params = {
          bankName: this.formInline.accountName,
          cityId: this.formInline.city,
          provinceId: this.formInline.province
        };
        // this.viewLoading = true
        getBankBranch(params).then((res) => {
            this.bankNameList = res.result
            this.isBankName = false
            // this.viewLoading = false
          })
          .catch(() => {
            // this.viewLoading = false;
          });
      },
      changesBranch(id) {
        //支行选择
        console.log(id)
        this.bankNameList.map((item, index) => {
          if (id == item.bankCode) {
            this.formInline.bankCode = item.bankCode;
            this.formInline.bankName = item.bankName;
          }
        });
      },

      handleChange(value) {
        //店铺类型选择
        let _this = this;
        console.log("value+++++++++++++", value[1], value);
        let list = this.typeLs.filter((item) => {
          if (item.id == value[0]) {
            return item;
          }
        });
        let listChild = list[0].children.filter((item) => {
          if (item.id == value[1]) {
            return item;
          }
        });
        _this.formInline.shopTypeParent = value[0];
        _this.formInline.shopType = value[1];
        _this.formInline.shopTypeName = listChild[0].label;
        console.log(
          "****",
          _this.formInline.shopTypeParent,
          _this.formInline.shopType,
          _this.formInline.shopTypeName
        );
      },

      changeRadio(e) {
        //经营期限选择
        console.log(e);
        if (e == 2) {
          this.pickDisabled = true;
          this.formInline.businessLicenseEndDate = "";
        } else {
          this.formInline.businessLicenseEndDate = "";
          this.pickDisabled = false;
        }
      },
      //获取进件商户基础信息
      getDetail() {
        const merchantId = this.merchantId;
        chainDetail(merchantId)
          .then((res) => {
            if (res.result.businessLicenseEndDate == "长期") {
              this.formInline.businessLicenseEndDate = "长期";
              this.radio = 2;
              this.pickDisabled = true;
            } else {
              this.formInline.businessLicenseEndDate = res.result.businessLicenseEndDate;
              this.pickDisabled = false;
              this.radio = 1;
            }
            this.formInline = res.result;
            this.$set(this.formInline,'standBankRegionAvalue',[])
            this.formInline.cities = []
            this.formInline.cities[0] = res.result.province
            this.formInline.cities[1] = res.result.city
            this.formInline.province = res.result.province
            this.formInline.city = res.result.city
            this.formInline.isSkip = 2
            this.isBankName = false
            this.getBankBranchs()
            //备用结算信息
            this.formInline.localStandBankName = res.result.localStandBankName
            this.formInline.localStandBankSubName = res.result.localStandBankSubName
            this.formInline.standBankCity = res.result.standBankCity
            this.formInline.standBankProvince = res.result.standBankProvince
            this.getBankBranchsStand()
            this.formInline.standBankSubCode = res.result.standBankSubCode
            this.formInline.standStlAccNo = res.result.standStlAccNo
            if(this.formInline.merchantType=='1' && this.formInline.settleBankType=='2' && res.result.standBankProvince!=''){
                let standBankRegionAvalue = [];
                standBankRegionAvalue.push(res.result.standBankProvince);
                standBankRegionAvalue.push(res.result.standBankCity);
                standBankRegionAvalue.join(",");
                this.formInline.standBankRegionAvalue = standBankRegionAvalue;
            }else{
                // this.$set(this.formInline,'standBankRegionAvalue',[])
                this.formInline.standBankRegionAvalue = []
            }
          })
          .finally(() => {
            this.loading = false;
          });
      },
      getbankType() {
        //获取结算方式字典
        const params = {
          dictType: "manage_settle_bank_type",
        };
        adminDict(params).then((res) => {
          this.settleBankTypeList = res.result[0].dictList;
        });
      },
      changeBankType(e) {
        //结算方式选择
        if (e == 3) {
          this.formInline.legalPersonName = "";
          this.formInline.legalPersonId = "";
          this.formInline.legalPersonIdSdate = "";
          this.formInline.legalPersonIdEdate = "";
        } else {
          this.formInline.unincorporatedName = "";
          this.formInline.unincorporatedId = "";
          this.formInline.unincorporatedIdSdate = "";
          this.formInline.unincorporatedIdEdate = "";
        }
      },

      handleAvatarSuccess(e, res, file) {
        this.allLoading = false;
        //上传资质图片
        //   this.formInline.shopIcon = res.result.url;
        if (res.code == 200) {
          if (e == 2) {
            this.formInline.businessLicenseImg = res.result.url;
            this.httpRequest(file)
            this.getlicenseInfo()
          } else if (e == 3) {
            this.formInline.shopTopImg = res.result.url;
          } else if (e == 4) {
            this.formInline.frontOfIdCard = res.result.url;
            this.getidCardInfo('zheng', this.formInline.frontOfIdCard)
          } else if (e == 5) {
            this.formInline.backOfIdCard = res.result.url;
            this.getidCardInfo('fan', this.formInline.backOfIdCard)
          } else if (e == 6) {
            this.formInline.permitForBankAccount = res.result.url;
          } else if (e == 7) {
            this.formInline.bankCard = res.result.url;
            this.getbankInfo()
          } else if (e == 8) {
            this.formInline.bankCardBack = res.result.url;
          } else if (e == 9) {
            this.formInline.fundFrontOfIdCard = res.result.url;
            this.getidCardInfo('feizheng', this.formInline.fundFrontOfIdCard)
          } else if (e == 10) {
            this.formInline.fundBackOfIdCard = res.result.url;
            this.getidCardInfo('feifan', this.formInline.fundBackOfIdCard)
          } else if (e == 11) {
            this.formInline.authorization = res.result.url;
          }
        } else {
          this.$message({
            message: res.message,
            type: "error",
            duration: 1500,
          });
        }

        console.log(this.formInline.businessLicenceImg);

      },
      //放大图片
      handleFang(url) {
        this.urlData = url;
        this.ImgDetailDialog = true;
      },
      onExceed(files, fileList) {
        this.$message.error("最多上传1张图片");
      },
      httpRequest(file) {
        console.log(file.raw);
        let params = new FormData();
        params.append("file", file.raw); // 文件对象
        console.log(params);
        watermarkUploadFile(params)
          // this.buttomLoading = true
          .then((res) => {
            console.log(res);
            this.formInline.watermarkBusinessLicenseImg = res.result.url
          })
          .finally(() => {});
      },
      beforeAvatarUpload(file) {
        console.log("file", file);
        const format = ["image/jpeg", "image/jpg", "image/png"];
        const isJPG = format.some((item) => file.type === item);
        // const isLt2M = file.size / 1024 / 1024 < 2;
        if (!isJPG) {
          this.$message.error("上传图片只能是 jpeg,jpg,png格式!");
        }
        //   if (!isLt2M) {
        //     this.$message.error("上传头像图片大小不能超过 2MB!");
        //   }
        // return isJPG && isLt2M;
        return isJPG;
      },
      handlePreview(e) {
        console.log(e);
        this.allLoading = true;
        setTimeout(() => {
          this.allLoading = false;
        }, 10000);
      },
      //取消
      handleClose() {
        this.$router.go(-1)
      },
      //提交资料
      submitForm(formName) {
        console.log('his.radio', this.radio)
        if (this.radio == 2) {
          this.formInline.businessLicenseEndDate = '长期'
        }
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.buttonLoading = true
            var data = {
              chainId: this.chainId,
              ...this.formInline
            }
            console.log('data', data)
            addChainstore(data).then(res => {
              this.$message({
                message: "新增成功",
                type: "success",
                duration: 1500,
              });
              this.buttonLoading = false
              this.$router.go(-1)
            }).catch(() => {
              this.buttonLoading = false
            })
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      updateMerchant(formName) {
        //更新信息
        if (this.radio == 2) {
          this.formInline.businessLicenseEndDate = '长期'
        }
        this.$refs[formName].validate((valid) => {
          if (valid) {
            const data = {
              merchantId: this.merchantId,
              ...this.formInline,
            };
            this.buttonLoading = true;
            editChainstore(data).then((res) => {
                this.$message({
                  message: "更新成功",
                  type: "success",
                  duration: 1500,
                });
                this.buttonLoading = false;
                setTimeout(() => {
                  this.$router.go(-1)
                }, 800);
              })
              .catch(() => {
                this.buttonLoading = false;
              });
          }
        })

      },
      //识别营业执照
      getlicenseInfo() {
        var params = {
          url: this.httpImg + this.formInline.businessLicenseImg
        }
        licenseInfo(params).then(res => {
          console.log('识别', res)
          this.formInline.businessLicenseNumber = res.result.businessLicenseNumber //营业执照号
          this.formInline.merchantName = res.result.merchantName
          this.formInline.name = res.result.name
          this.formInline.address = res.result.address
          this.formInline.merchantType = res.result.merchantType
        })
      },
      //身份证识别
      getidCardInfo(type, url) {
        var params = {
          url: this.httpImg + url
        }
        idCardInfo(params).then(res => {
          console.log('识别身份证', res)
          if (type == 'zheng') {
            this.formInline.legalPerson = res.result.name
            this.formInline.legalPersonId = res.result.idCard
          } else if (type == 'fan') {
            this.formInline.legalPersonIdCardValidDate = res.result.idCardValidDate
          } else if (type == 'feizheng') {
            this.formInline.fundLegalPerson = res.result.name
            this.formInline.fundLegalPersonId = res.result.idCard
          } else if (type == 'feifan') {
            this.formInline.fundLPersonIdCardValidDate = res.result.idCardValidDate
          }
        })
      },
      //识别银行卡
      getbankInfo() {
        var params = {
          url: this.httpImg + this.formInline.bankCard
        }
        bankInfo(params).then(res => {
          console.log('识别', res)
          this.formInline.accountNo = res.result.cardNo //营业执照号
          this.formInline.accountName = res.result.bankName
        })
      },
      // getBankCitys() { //中台查询银盛城市
      //       let params = {}
      //       bankCity(params).then((res) => {
      //       this.bankCityOptions = res.result;
      //       this.bankCityOptions.forEach((item) => {
      //           item.children.forEach((items) => {
      //               if (items.children.length == 0) {
      //                   items.children = null
      //               }
      //           })
      //       })
      //       });
      //   },
      // 查询备用匹配开户行
      openingBankStand(e){
          var params = {
              bankCardNo:e
          }
          this.mateLoading = true
          entryV1FuncYSBankBin(params).then(res=>{
              var {bankName} = res.result
              if(bankName!= ''){
                  this.formInline.localStandBankName = bankName
                  this.$message({ message: "查询成功", type: "success", duration: 1500,});
                  this.mateLoading = false
              }else{
                  this.$message({ message:'未查询到银行卡开户行相关信息', type: "error", duration: 1500,});
                  this.mateLoading = false
              }
          }).catch(()=>{
              this.mateLoading = false
          })
      },
      //备用银行区域选择
      standBankRegionChange(value){
          if (value.length == 0) {
            this.formInline.standBankRegionAvalue = []
            this.formInline.standBankSubCode = '';
            this.formInline.localStandBankSubName = '';
            this.bankOptiontwoStand = []
            return
          }
          this.formInline.standBankProvince = value[0];
          this.formInline.standBankCity = value[1];
          if (this.formInline.localStandBankName == '') {
            this.$message.error('请输入开户行名称');
            this.$refs['standBankRegionAvalueRef'].clearValidate();
            this.formInline.standBankRegionAvalue = []
            this.formInline.standBankSubCode = '';
            this.formInline.localStandBankSubName = '';
            this.bankOptiontwoStand = []
            return
          } else {
              this.formInline.standBankRegionAvalue = [value[0],value[1]]
              this.$refs['standBankRegionAvalueRef'].clearValidate();
              this.getBankBranchsStand()
          }
          this.formInline.standBankSubCode = '';
          this.formInline.localStandBankSubName = '';
      },
      getBankBranchsStand() { //获取备用支行信息
          const params = {
              bankName: this.formInline.localStandBankName,
              cityId: this.formInline.standBankCity,
              provinceId: this.formInline.standBankProvince
          };
          this.viewLoading = true
          bankBranch(params).then((res) => {
              this.bankOptiontwoStand = res.result
              this.viewLoading = false
          })
          .catch(() => {
              this.viewLoading = false;
          });
      },
      //备用支行选择
      changesTwoStand(id) {
          //支行选择
          this.bankOptiontwoStand.map((item, index) => {
          if (id == item.bankCode) {
              this.formInline.standBankSubCode = item.bankCode;
              this.formInline.localStandBankSubName = item.bankName;
          }
        });
      },
    },
  };

</script>
<style lang="scss" scoped>
  @import "../style/storeAdd";

  ::v-deep.el-input,
  .el-select {
    width: 350px !important;
  }

  .el-textarea {
    width: 350px !important;
  }

  .import {
    color: #ff4949;
  }
  .standby_txt{
    font-size: 14px;
    color: #1890ff;
    margin: 0 0 10px 70px;
  }
</style>
